import {INCREMENT} from './types'
import getters from './getters'
const state={
    count:20
}

const mutations={
    [INCREMENT](state){
        state.count++
    },
    decrement:({commit})=>{
        state.count--
    },
    clickOdd:({commit,state})=>{
        console.log(state.count)
        if(state.count%2==0){
            commit('increment')
        }
    },
    clickAsync:({commit,state})=>{
        commit('clickAsync')
    }
    
}

export default{
    state,
    mutations,
    getters
}